using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization;

namespace Microsoft.Practices.Repository
{
    /// <summary>
    /// This class is the base class for all exceptions from our
    /// repositories.
    /// </summary>
    [Serializable]
    public class RepositoryException : Exception
    {
        /// <summary>
        /// Initializes a new instance of RepositoryException class.
        /// </summary>
        public RepositoryException() : base()
        {
        }

        /// <summary>
        /// Initializes a new instance of RepositoryException class.
        /// </summary>
        /// <param name="message">The message that describes the error</param>
        public RepositoryException(string message)
            : base(message)
        {
        }

        /// <summary>
        /// Initializes a new instance of RepositoryException class.
        /// </summary>
        /// <param name="message">The message that explains the reason for the exception.</param>
        /// <param name="inner">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>
        public RepositoryException(string message, Exception inner)
            : base(message, inner)
        {
        }

        /// <summary>
        /// Initializes a new instance of RepositoryException class.
        /// </summary>
        /// <param name="info">The System.Runtime.Serialization.SerializationInfo that holds the serialized data
        /// about the exception being thrown.</param>
        /// <param name="context">The System.Runtime.Serialization.SerializationContext that contains contextual informationa about
        /// the source or destination.</param>
        protected RepositoryException(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
    }
}
